package com.chenyun.mq.rabbitmq;

import cn.hutool.extra.spring.SpringUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;


/**
 *
 * rabbitmq帮助类
 * @author: lonni
 * @CreateTime: 2023-12-02  16:53
 * @Description:
 */
@Slf4j
public class RabbitMqUtil {

    public static RabbitMqUtil me=new RabbitMqUtil();

    private RabbitMqUtil(){}


    /**
     * 拿到模板类 ,包含发布确认的
     * @return
     */
    public RabbitTemplate confirm(){
        return SpringUtil.getBean("rabbitTemplateConfirm", RabbitTemplate.class);
    }

    /**
     * 拿到普通模板类 ,不包含发布确认
     * @return
     */
    public RabbitTemplate template(){
        return SpringUtil.getBean("rabbitTemplate", RabbitTemplate.class);
    }


}
